package com.qdlc.p2p.biz.log.score;

import com.qdlc.p2p.common.constant.ScoreTemplateConstant;
import com.qdlc.p2p.dal.dto.ScoreType;

/**
 * 投资积分父类
 */
public class BaseTenderScoreLog extends BaseScoreLog {

	private static final long serialVersionUID = 1L;

	public BaseTenderScoreLog() {
		super();
	}
	
	public BaseTenderScoreLog(long userId,int score, String scoreTypeNid) {
		super(userId, score, scoreTypeNid);
	}
	
	/**
	 * 根据ScoreType配置信息，得到获得的积分
	 * @param typeNid
	 * @return
	 */
	public int getScoreValue(String typeNid){
		int scoreValue = 0;
		ScoreType type = scoreTypeDao.getScoreTypeByNid(typeNid);
		if (type != null && type.getStatus() == ScoreTemplateConstant.SCORE_TYPE_ENABLE) {
			scoreValue = type.getValue();
		}
		return scoreValue;
	}
}
